import request from '@/utils/http'
const api = new Object()

// 轮播图
api.getbanner = params => request('post', '/api/index/getbanner', params)
// 获取当前所在区域
api.getarea = params => request('post', '/api/index/getarea', params)
// 获取切换选择的地址
api.getqharea = params => request('post', '/api/index/getqharea', params)
// 获取分类
api.getcategory = params => request('post', '/api/index/getcategory', params)
//  获取商品
api.getcateshop = params => request('post', '/api/index/getcateshop', params)
// 搜索商品
api.search = params => request('post', '/api/index/search', params)
// 获取分类下的商品
api.getcategoods = params => request('post', '/api/goods/getcategoods', params)
// 搜索历史
api.getrecordSer = params => request('post', '/api/index/getrecordSer', params)
// 删除全部历史
api.delrecordSer = params => request('post', '/api/index/delrecordSer', params)

// 商品详情
api.getGoodDetails = params => request('post', '/api/goods/details', params)
// 获取商品评论
api.getMessGoods = params => request('post', '/api/goods/messGoods', params)
// 直接购买数据（结算数据）
api.buydata = params => request('post', '/api/goods/buydata', params)
// 直接购买支付
api.goodsPay = params => request('post', '/api/goods/pay', params)
// 识别身份证号
api.ocrIdcard = params => request('post', '/api/common/ocrIdcard', params)
// 识别B超单/出生证明
api.ovrFile = params => request('post', '/api/common/ovrFile', params)

// 购物车列表
api.getCartList = params => request('post', '/api/cart/index', params)
// 添加到购物车
api.addCart = params => request('post', '/api/cart/add', params)
// 增加购物车中某条数量
api.addGoods = params => request('post', '/api/cart/inc', params)
// 减少购物车中某条数量
api.reduceGoods = params => request('post', '/api/cart/sub', params)
// 删除购物车中某条
api.delGoods = params => request('post', '/api/cart/del', params)
// 购物车结算
api.cartClose = params => request('post', '/api/cart/cartClose', params)
// 购物车支付
api.cartPay = params => request('post', '/api/cart/pay', params)

// 获取订单列表
api.getOrderList = params => request('post', '/api/order/getOrderList', params)
// 订单详情
api.getorderDet = params => request('post', '/api/order/getorderDet', params)
// 获取薅羊毛增选服务
api.getgiveServerList = params => request('post', '/api/goods/getgiveServer', params)
// 取消订单
api.offorder = params => request('post', '/api/order/offorder', params)
// 确认订单
api.conorder = params => request('post', '/api/order/conorder', params)
// 评价
api.messorder = params => request('post', '/api/order/messorder', params)
// 退款退货
api.refound = params => request('post', '/api/order/refound', params)
// 订单支付
api.orderAllPay = params => request('post', '/api/order/pay', params)
// 邮寄
api.youji = params => request('post', '/api/order/youji', params)

// 地址列表
api.getRessList = params => request('post', '/api/address/index', params)
// 设置地址
api.address = params => request('post', '/api/address/add', params)
// 删除地址
api.delress = params => request('post', '/api/address/del', params)
// 地址详情
api.ressDetail = params => request('post', '/api/address/detail', params)
// 修改默认地址
api.setDefault = params => request('post', '/api/address/setDefault', params)
// 获取默认地址
api.getDefaultRess = params => request('post', '/api/address/getAddress', params)

// 获取我的信息
api.getuserinfo = params => request('post', '/api/user/getuserinfo', params)
// 修改会员个人信息
api.profile = params => request('post', '/api/user/profile', params)
// 获取提现说明
api.getdrawdet = params => request('get', '/api/confdom/getdrawdet', params, 'queryString')
// 积分明细
api.getScoreDetail = params => request('post', '/api/user/getScoreDetail', params)
// 提现
api.posit = params => request('post', '/api/user/posit', params)
// 我的分享码
api.getmyQr = params => request('get', '/api/user/getmyQr', params, 'queryString')
// 手机号授权登录
api.login = params => request('post', '/api/user/login', params)
// 录入用户预产期
api.expectDate = params => request('post', '/api/user/expectDate', params)

// 商家端
// 商家入驻
api.addEnter = params => request('post', '/api/merchant/enter', params)
// 判断商家入驻
api.merchEnter = params => request('post', '/api/user/merch', params)
// 商家端登陆
api.merchLogin = params => request('post', '/api/merchant/login', params)
// 商家订单
api.merchOrderList = params => request('post', '/api/merchant/order', params)
// 发布项目
api.merchNewProject = params => request('post', '/api/merchant/newProject', params)
// 确认订单
api.finshOrder = params => request('post', '/api/merchant/finshOrder', params)
// 商家信息
api.getMerchInfo = params => request('post', '/api/merchant/getInfo', params)
// 设置商家头像昵称
api.setMerchInfo = params => request('post', '/api/merchant/setInfo', params)
// 查看我的项目
api.getMyProject = params => request('get', '/api/merchant/myProject', params, 'queryString')

// 富文本之类
// 客服电话
api.mykefu = params => request('get', '/api/confdom/mykefu', params, 'queryString')
// 获取用户协议
api.getuserdet = params => request('get', '/api/confdom/getuserdet', params, 'queryString')
// 获取隐私协议
api.getpoldet = params => request('get', '/api/confdom/getpoldet', params, 'queryString')
// 获取服务协议
api.getserdet = params => request('get', '/api/confdom/getserdet', params, 'queryString')
export default api
